class CollectDeviceInitResultModel {
  late int code;
  late String message;
  late Content content;

  CollectDeviceInitResultModel(
      {required this.code, required this.message, required this.content});

  CollectDeviceInitResultModel.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    message = json['message'];
    content = (json['content'] != null
        ? new Content.fromJson(json['content'])
        : null)!;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['message'] = this.message;
    if (this.content != null) {
      data['content'] = this.content.toJson();
    }
    return data;
  }
}

class Content {
  late int total;
  late int page;
  late int perPage;
  late Data data;

  Content(
      {required this.total,
      required this.page,
      required this.perPage,
      required this.data});

  Content.fromJson(Map<String, dynamic> json) {
    total = json['total'];
    page = json['page'];
    perPage = json['per_page'];
    data = (json['data'] != null ? new Data.fromJson(json['data']) : null)!;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['total'] = this.total;
    data['page'] = this.page;
    data['per_page'] = this.perPage;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}

class Data {
  late String address;
  late String initNum;
  late String unit;
  late String cycle;
  late String periodStart;
  late String periodEnd;
  late String threshold;
  late String interval;

  Data(
      {required this.address,
      required this.initNum,
      required this.unit,
      required this.cycle,
      required this.periodStart,
      required this.periodEnd,
      required this.threshold,
      required this.interval});

  Data.fromJson(Map<String, dynamic> json) {
    address = json['address'];
    initNum = json['init_num'];
    unit = json['unit'];
    cycle = json['cycle'];
    periodStart = json['period_start'];
    periodEnd = json['period_end'];
    threshold = json['threshold'];
    interval = json['interval'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['address'] = this.address;
    data['init_num'] = this.initNum;
    data['unit'] = this.unit;
    data['cycle'] = this.cycle;
    data['period_start'] = this.periodStart;
    data['period_end'] = this.periodEnd;
    data['threshold'] = this.threshold;
    data['interval'] = this.interval;
    return data;
  }
}
